1. NodeBox 1
    1. Homepage
    2. NodeBox 3Node-based app for generative design and data visualization
    3. NodeBox OpenGLHardware-accelerated cross-platform graphics library
    4. NodeBox 1Generate 2D visuals using Python code (Mac OS X only)
  2. Gallery
  3. Documentation
  4. Forum
  5. Blog

Reference | push()


Syntax
push()

DescriptionNodeBox is a so-called state-machine. For example, once rotate(45) is called, all subsequent shapes, paths, text and images are rotated 45 degrees. The rotation state is 45 degrees. The push() and pop() commands allow for a state within a state. All transformations, such as rotate() and skew(), defined between a push() and pop() call last only until pop() is called. Thereafter the previous state is used. For example, a rotate(-30) within a rotate(45) means a rotation state of 15 degrees until pop() is called and the rotation state becomes 45 degrees again.
Tutorial Graphics State 


Example
fill(0.2)
fontsize(14)
rotate(90)
text("one", 40, 80)
 
push()
rotate(-90)
text("two", 40, 40)
pop()
 
text("three", 50, 80)